import {TaskApplyData} from "../../type/Type";
import {ControllerNo} from "./ControllerOpt";
import {AbilityJson, ItemJson, UnitJson} from "../../frame/apiModel/model/StoreJson";

export interface SerializeBody {
}

export class SerializeBodyHistory implements SerializeBody {
    [ControllerNo.UnitController]: UnitSerializeBody;
    [ControllerNo.AbilityController]: AbilitySerializeBody;
    [ControllerNo.StoreController]: StoreSerializeBody;
    [ControllerNo.AchievementController]: AchievementSerializeBody;
    [ControllerNo.GoodController]: GoodsSerializeBody;
    [ControllerNo.TaskController]: TaskSerializeBody;
}

export class RoomItem {
}

export class RPGRoomItem extends RoomItem {
    fightValue: number;
    wave: number;
    level: number;
}
export class LIVERoomItem extends RoomItem {
    difficult: string;
}


export class AbilitySerializeBody implements SerializeBody {
    qa: AbilityJson;
    wa: AbilityJson;
    ea: AbilityJson;
    ra: AbilityJson;
}
export class UnitSerializeBody implements SerializeBody {
    hi1: UnitJson;
    hi2: UnitJson;
    hi3: UnitJson;

    bi: UnitJson;
    pi_1: UnitJson;
    pi_2: UnitJson;
    pi_3: UnitJson;
    pi_4: UnitJson;
    pi_5: UnitJson;
    pi_6: UnitJson;
    pi_7: UnitJson;
    pi_8: UnitJson;
    pi_9: UnitJson;
    pi_10: UnitJson;
}

export class AppInfo {
    id?: string;
}

export class AchievementSerializeBody implements SerializeBody {
    [key: string]: number | AppInfo;
    integ: number;
    freeExp: number;

    lock_1: number;
    lock_2: number;
    lock_3: number;

    ha1: AppInfo;
    ha2: AppInfo;
    hw: AppInfo;
    hr: AppInfo;
    ht: AppInfo;
    hs: AppInfo;
    bs: AppInfo;
}

export class TaskSerializeBody implements SerializeBody {
    // taskId
    [key: string]: TaskApplyData
}

export class GoodsSerializeBody implements SerializeBody {
    hg1_1: ItemJson;
    hg1_2: ItemJson;
    hg1_3: ItemJson;
    hg1_4: ItemJson;
    hg1_5: ItemJson;
    hg1_6: ItemJson;

    hg2_1: ItemJson;
    hg2_2: ItemJson;
    hg2_3: ItemJson;
    hg2_4: ItemJson;
    hg2_5: ItemJson;
    hg2_6: ItemJson;

    hg3_1: ItemJson;
    hg3_2: ItemJson;
    hg3_3: ItemJson;
    hg3_4: ItemJson;
    hg3_5: ItemJson;
    hg3_6: ItemJson;

    bg1_1: ItemJson;
    bg1_2: ItemJson;
    bg1_3: ItemJson;
    bg1_4: ItemJson;
    bg1_5: ItemJson;
    bg1_6: ItemJson;

    bg2_1: ItemJson;
    bg2_2: ItemJson;
    bg2_3: ItemJson;
    bg2_4: ItemJson;
    bg2_5: ItemJson;
    bg2_6: ItemJson;

    bg3_1: ItemJson;
    bg3_2: ItemJson;
    bg3_3: ItemJson;
    bg3_4: ItemJson;
    bg3_5: ItemJson;
    bg3_6: ItemJson;


    eq1_1: ItemJson;
    eq1_2: ItemJson;
    eq1_3: ItemJson;
    eq1_4: ItemJson;
    eq1_5: ItemJson;
    eq1_6: ItemJson;
    eq1_7: ItemJson;
    eq1_8: ItemJson;
    eq1_9: ItemJson;


    eq2_1: ItemJson;
    eq2_2: ItemJson;
    eq2_3: ItemJson;
    eq2_4: ItemJson;
    eq2_5: ItemJson;
    eq2_6: ItemJson;
    eq2_7: ItemJson;
    eq2_8: ItemJson;
    eq2_9: ItemJson;


    eq3_1: ItemJson;
    eq3_2: ItemJson;
    eq3_3: ItemJson;
    eq3_4: ItemJson;
    eq3_5: ItemJson;
    eq3_6: ItemJson;
    eq3_7: ItemJson;
    eq3_8: ItemJson;
    eq3_9: ItemJson;

    gb_1: ItemJson;
    gb_2: ItemJson;
    gb_3: ItemJson;
    gb_4: ItemJson;
    gb_5: ItemJson;
    gb_6: ItemJson;
    gb_7: ItemJson;
    gb_8: ItemJson;
    gb_9: ItemJson;
    gb_10: ItemJson;
    gb_11: ItemJson;
    gb_12: ItemJson;
    gb_13: ItemJson;
    gb_14: ItemJson;
    gb_15: ItemJson;
    gb_16: ItemJson;
    gb_17: ItemJson;
    gb_18: ItemJson;
    gb_19: ItemJson;
    gb_20: ItemJson;
    gb_21: ItemJson;
    gb_22: ItemJson;
    gb_23: ItemJson;
    gb_24: ItemJson;
    gb_25: ItemJson;
    gb_26: ItemJson;
    gb_27: ItemJson;
    gb_28: ItemJson;
    gb_29: ItemJson;
    gb_30: ItemJson;
}
export class StoreSerializeBody implements SerializeBody {
    diff: number;
    time: number;
    coin: number;
    wood: number;
    pop: number;
    userId: string;
}

export enum SerializeLoadType {
    // 单存档不包含全局数据
    current_archive,
    // 全部存档不包含全局数据
    all_archive,
    // 单存档包含全局数据
    current_global,
    // 全部存档包含全局数据
    all_global,
}

export enum ItemLoadType {
    hg,
    bg,
    gb,
    eq,
}

export enum UnitLoadType {
    hi,
    bi,
    pi,
}

export enum AbilityLoadType {
    q,
    w,
    e,
    r,
    t,
    y,
    u,
}

export enum AchLoadType {
    other,
    lock,
    app,
    ach,
    handBook,
}